﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BeerStats.Data.Mappings;
using BeerStats.Models;

namespace BeerStats.Data
{
    public class BeerStatsDbContext: DbContext
    {
        public BeerStatsDbContext()
            :base("BeerStatsDb")
        {
        }

        public IDbSet<Beer> Beers { get; set; }
        public IDbSet<BeerType> BeerTypes { get; set; }
        public IDbSet<User> Users { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new BeerMap());
            modelBuilder.Configurations.Add(new BeerTypeMap());
            modelBuilder.Configurations.Add(new UserMap());


            base.OnModelCreating(modelBuilder);
        }
    }
}
